var fs = require('fs')

var http = require('http')

var server = http.createServer()

var wwwDir = 'C:'

server.on('request', function(req, res) {
    var url = req.url

    var filePath = '/index.html'

    if (url !== '/') {
        filePath = url
    }
    fs.readFile(wwwDir + filePath, function(err, data) {
        console.log(err)
        res.end(data)
    })

})


server.listen(3000, function() {
    console.log('server is runing...')
})